package com.woniuxy.order.ES;

import org.elasticsearch.client.RequestOptions;
import org.elasticsearch.client.RestHighLevelClient;
import org.elasticsearch.client.indices.CreateIndexRequest;
import org.elasticsearch.client.indices.CreateIndexResponse;

import javax.annotation.Resource;
import java.io.IOException;

public class ElasticSearch {
    @Resource
    RestHighLevelClient restHighLevelClient;
    public void creatIndex() throws IOException {

        CreateIndexRequest request = new CreateIndexRequest("student");
        CreateIndexResponse response = restHighLevelClient.indices().create(request, RequestOptions.DEFAULT);

    }

}
